import { sm2 } from 'sm-crypto'

const privateKey = 'd00996395ccee3bced80c4bed01bb1bcfdf3d452277640de1b993e84190e3b99'
const publicKey = '040ce3204ce50f09409c627ff86e99f0ad1855301da6906323061d5cd769269df1c5803e355bb7a8d5f1f6ad39684191deeb732c62facbd28dfac4cebc5de3127d'

/**
 * 前端加密
 * @param text
 * @returns {*}
 */

export function encrypt(text) {
  return sm2.doEncrypt(text, publicKey, 1) // 加密结果
}

/**
 * 前端解密
 * @param text
 * @returns {*}
 */
export function decrypt(text) {
  return sm2.doDecrypt(text, privateKey, 1) // 加密结果
}

